'''
栈：先进后出
'''
# mystack = []
# # 进栈
# mystack.append(1)
# print(mystack)
# mystack.append(2)
# print(mystack)
# mystack.append(3)
# print(mystack)
# mystack.append(4)
# print(mystack)
# # 出栈
# mystack.pop()
# print(mystack)
# mystack.pop()
# print(mystack)
# mystack.pop()
# print(mystack)
# mystack.pop()
# print(mystack)

# 队列：先进先出
from collections import deque
queue = deque([1, 2, 3, 4])
# 进队

queue.append(5)
print(queue)

queue.append(6)
print(queue)
queue.append(7)
print(queue)
# 出队
queue.popleft()
print(queue)
queue.popleft()
print(queue)
queue.popleft()
print(queue)

